Once past the typedefs, the global variables will be mostly ready to go exactly as they are. And the rest of the file will be relatively easy to edit.
If CTools™ hits a “Str4[4]” it will scramble it with a previous type. Just look at the Pascal file and see how it’s supposed to be and fix it. This is just another thing on my list of things to correct (will it ever end!).
The biggest “pest” of the editing process is screwed up character case. It may say “itemHit” 20 times in the file, and one or two times it will say “ItemHit” or “itemhit” or even “ITEMHIT”. My KodeKeys macros handle this. And, whenever you encounter ANYTHING that gives a compiler error, correct it for the rest of the file right then and there.
One important thing is, when you use Find/Replace, be SURE you evaluate whether to set “Ignore Case”, “Wrap Around” and “Whole Words” FIRST. The “Selection - Replace All” KodeKeys sequence I just mentioned MUST have “Whole Words” checked before using it. Otherwise it will mess up some things.
Using Find/Replace for C source from a Pascal conversion is an art, to selectively edit the whole file precisely.
Sometimes you will fix something in the rest of the file and it will mess up something you already edited. Should’ve had “Wrap Around” unchecked! See?
The oddball character case boo-foos usually show up with the “xxxx has not been declared” compiler error, but you KNOW it has already been declared (the ONE exception to this is in a “with” block). So, it was declared and used earlier, but with one or more characters in the wrong case. I can correct this so it’s automatically handled. Until then... (ho hum)...
The quickest way to handle this is to get the one where you are like you want all of them to be, select it, copy it, and paste it in the Find dialog for both the search string and the replace-with string, and then Replace All (Whole Words checked). Editing this one word for character case is made easy by having a macro in CMaster™ to invert case. I do this with one key hit of the “back accent” key (upper left of keyboard). I’ve never used that character for anything else, so I use it for that. I hit it and the next character gets inverted, case-wise. Or on a selection and the entire selectio inverts case. EXCELLENT! Handy!
For those of you using KodeKeys, simply edit the word to your liking (don’t add or subtract characters), select it, then hit ctrl-[0] (control, keypad 0) and the sequence will be executed. It’s mega-fast and easy! (Make sure “Whole Words” is checked before doing this.)